package com.lr.server.demo1;

import java.net.Socket;

public class Dispatcher implements Runnable{

	private Request request;
	
	private Response response;
	
	private Socket socket;
	
	private int code = 200;
	
	public Dispatcher(Socket socket){
		this.socket = socket;
		request = new Request(socket);
		response = new Response(socket);
	}
	
	@Override
	public void run() {
		Servlet servlet = new Servlet();
		servlet.service(request,response);
		response.response(200);
		response.colse();
		request.close();
	}

}
